package com.yupi.yupicturebackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yupi.yupicturebackend.model.dto.picture.PictureQueryRequest;
import com.yupi.yupicturebackend.model.dto.space.SpaceAddRequest;
import com.yupi.yupicturebackend.model.dto.space.SpaceQueryRequest;
import com.yupi.yupicturebackend.model.entity.Picture;
import com.yupi.yupicturebackend.model.entity.Space;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.yupicturebackend.model.entity.User;
import com.yupi.yupicturebackend.model.vo.PictureVO;
import com.yupi.yupicturebackend.model.vo.SpaceVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author zhonghaoming
* @description 针对表【space(空间)】的数据库操作Service
* @createDate 2025-09-03 00:03:22
*/
public interface SpaceService extends IService<Space> {

    /**
     * 校验
     *
     * @param space
     */
    public void validSpace(Space space, boolean add);
    /**
     * 获取空间封装
     *
     * @param space
     * @param request
     * @return
     */
    public SpaceVO getSpaceVO(Space space, HttpServletRequest request);
    /**
     * 获取空间分页封装
     *
     * @param spacePage
     * @param request
     * @return
     */
    public Page<SpaceVO> getSpaceVOPage(Page<Space> spacePage, HttpServletRequest request);


    public QueryWrapper<Space> getQueryWrapper(SpaceQueryRequest spaceQueryRequest);

    /**
     * 根据等级填充空间信息
     *
     * @param space
     */
    public void fillSpaceByLevel(Space  space);

    public long addSpace(SpaceAddRequest spaceAddRequest, User loginUser);

    public void checkSpaceAuth(User loginUser,Space space);
}
